<table width="100%" border=0 cellpadding=0 cellspacing=0>
  <tr>
    <td>
      <table cellpadding="3" cellspacing="0" border="0" width="100%">
        <tr bgcolor="#7EC1F3">
          <td align=left><a href="<%=BoxStatic.servletDir%>BoxCalendarAction?t=<%=(currentDate.getTime().getTime()-1000*60*60*24*7)%>">
              <img SRC="<%=BoxStatic.imageDir%>cal_left.gif" WIDTH="11" HEIGHT="11" BORDER="0">Previous week</a>
          </td>
          <td align=center>
            <font face="Arial,Helvetica" SIZE="+1">
            <b><%=BoxCalHome.getWeekRangeString(currentDate)%></b>
            </font>
          </td>
          <td align=right>
            <a href="<%=BoxStatic.servletDir%>BoxCalendarAction?t=<%=(currentDate.getTime().getTime()+1000*60*60*24*7)%>">
            Next week<img SRC="<%=BoxStatic.imageDir%>cal_right.gif" WIDTH="11" HEIGHT="11" BORDER="0"></a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td valign="top" >
      <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr bgcolor="#cccccc">
          <td>
            <table cellpadding="3" cellspacing="1" border="0" width="100%">
<%
  Calendar tmpDay = (Calendar)currentDate.clone();
  int weekStartDay = sec.getConfigInt("calendar", "General", "Week Start Day");
  if (weekStartDay!=0) // current day
    tmpDay.set(Calendar.DAY_OF_WEEK,weekStartDay);
  tmpDay.set(Calendar.HOUR_OF_DAY,0);
  tmpDay.set(Calendar.MINUTE,0);
  tmpDay.set(Calendar.SECOND,0);
  for(int i = 0; i < 7; i++)
  {
%>
              <tr>
                <td bgcolor="#<%
                  // Check if it's today
                  if ( today.get(Calendar.DAY_OF_YEAR) == tmpDay.get(Calendar.DAY_OF_YEAR)
                  && today.get(Calendar.YEAR) == tmpDay.get(Calendar.YEAR) )
                    out.print("ffffcc");
                  else
                    out.print("dcdcdc");
                  %>">
                  <table cellpadding="0" cellspacing="0" border="0">
                    <tr>
                      <td align="left">
                        <font size="-1" face="Arial,Helvetica">
	                        <%=BoxStatic.weekSymbols[tmpDay.get(Calendar.DAY_OF_WEEK)]%>,
                          <a href="<%=BoxStatic.servletDir%>BoxCalendarAction?v=day&t=<%=tmpDay.getTime().getTime()%>">
	                        <b><%=StringUtil.getDateTimeFormatString(sec.getTimeZone(), BoxStatic.LONG_DATE_FORMAT, tmpDay.getTime())%></b></a>
                        </font>
                      </td>
                      <td nowrap align="right" width="1%"><font size="-3" face="Arial,Helvetica">
                        &nbsp;
<%
										if (curID == curCalUserID)
                    {
%>
                        <a href="<%=BoxStatic.servletDir%>BoxCalendarAction?SubmitEdit=edit&t=<%=(tmpDay.getTime().getTime()+1000*60*60*workStartHour)%>">Add Event</a>
<%
										}
%>

                        </font>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
<%

    Iterator it = BoxCalHome.getAllDayEntries(curID, tmpDay,curCalUserID);
    if (it !=null && it.hasNext())
    {
      while (it.hasNext())
      {
        BoxCalendarEntry bean = (BoxCalendarEntry) it.next();
        if ( bean != null )
        {
%>
              <tr bgcolor="white">
                <td valign="top" align="left">
                  <font size="-1">
                    <a href="<%=BoxStatic.servletDir%>BoxCalendarAction?SubmitEdit=edit&id=<%=bean.getID()%>"
                      >&nbsp;&nbsp;&nbsp;All day&nbsp;
					            <Calendar:CalendarEntry timezone="<%=sec.getTimeZone()%>" viewerid="<%=curID%>" showtime="false" showdelete="true" calendarentry="<%=bean%>"/>
                  </font>
                </td>
              </tr>
<%
        }
      }
    }

    it = BoxCalHome.getEntries(curID, tmpDay,curCalUserID);
    if (it !=null && it.hasNext())
    {
      while (it.hasNext())
      {
        BoxCalendarEntry bean = (BoxCalendarEntry) it.next();
        if ( bean != null )
        {
%>
              <tr bgcolor="white">
                <td valign="top" align="left">
                  <font size="-1">
					            &nbsp;&nbsp;&nbsp;<Calendar:CalendarEntry timezone="<%=sec.getTimeZone()%>" viewerid="<%=curID%>" showtime="true" showdelete="true" calendarentry="<%=bean%>"/>
                  </font>
                </td>
              </tr>
<%
        }
      }
    }
    else
    {
       out.print("<tr> <td bgcolor=\"#eeeeee\"><br> </td> </tr>");
    }
    tmpDay.add(Calendar.DATE,1);
  }
%>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td align="middle" height="10"><font color="#ffffff">___ ___ ___ ___ ___ ___ ___ ___ ___
    ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___
    ___ ___ ___ ___ ___ ___ ___ ___ ___ </font></td>
  </tr>
</table>
